
CXX		= g++ -g
LOCAL_INC       = -I. -Iinclude
LOCAL_INC	+=  $(shell root-config --cflags) 
CXXFLAGS        += -g $(LOCAL_INC)

LOCAL_LIBS += -lstdc++
LOCAL_LIBS += -lgfortran
LOCAL_LIBS += $(shell root-config --glibs --evelibs) -lTreePlayer
LDLIBS     += $(LOCAL_LIBS)


TARGETS = libdukedaq.a dukedaq 
OBJ_ROOTCINT = DDMainWindow.o DDEventManager.o
INC_ROOTCINT = include/DDMainWindow.hh  include/DDEventManager.hh
#OBJS = dict.o DDVAnalysis.o DDChargeAnalysis.o DDVData.o DDDummyData.o DDVVisualAnalysis.o defaultrootstyle.o DDVDAQ.o DDDummyDAQ.o
OBJS = dict.o DDVAnalysis.o DDChargeAnalysis.o DDVData.o DDDummyData.o defaultrootstyle.o DDVDAQ.o DDDummyDAQ.o
OBJS += $(OBJ_ROOTCINT)  

all: $(TARGETS)

%.o: ./src/%.cc ./include/%.hh
	LD_RUN_PATH=$(LIBDIR):$(SKOFL_LIBDIR) $(CXX) -c $(CXXFLAGS) -o $@ ./src/$*.cc
%.o: ./src/%.cc
	$(CXX) -c $(CXXFLAGS) -g -o $@ ./src/$*.cc
%.o: ./src/%.F
	gfortran -c $(FFLAGS) -o $@ ./src/$*.F
dict.o: $(OBJS_ROOTCINT)
	rootcint -f rootcint/dict.cc -c $(INC_ROOTCINT) $^ rootcint/LinkDef.h
	$(CXX) -c $(CXXFLAGS) -g rootcint/dict.cc -o dict.o
libdukedaq.a: $(OBJS)
	ar clqs $@ $^
	ranlib $@
dukedaq: dukedaq.o libdukedaq.a
	$(CXX) $(CXXFLAGS) -o $@ $(OTHERLIBS) $(LDLIBS) -L. $^
main: main.o
	$(CXX) $(CXXFLAGS) -o $@ $(LDLIBS) -L. -ldukedaq $^ 
clean:: 
	$(RM) -f *.o *.so *.a
	rm -f $(TARGETS) $(OBJ_LIB) rootcint/dict*

install.exec:: 

setup::

includes::

install.includes::

depend::

lib::
	$(OBJECTS)

install.lib::

exec:: 

install.exec:: 


